function [rank_deficient] = check_rank_deficiency(X)
tol = 1e-8;
rank_deficient = 0;

if min(eig(X.B)) < tol,
    rank_deficient = 1;
end

end






